<?php

// 4/24/2010: immanuel192 write this module

class biblemodule {
	function name() { return 'Bible Module'; }
	function description() { return 'Bible module, for bible reading and searching'; }
	function author() { return 'Immanuel192'; }

	function hasSources() { return true; }
	function hasContent() { return false; }
	function hasViews() { return true; }

	function supportsWorkflow() { return false; }

	function permissions($internal = '',$type =0) {
		if ($type == 0) {
			$i18n = exponent_lang_loadFile('modules/biblemodule/class.php');
			return array(
				'administrate'=>$i18n['perm_administrate'],
				'manage'=>$i18n['perm_manage_listing'],
				'configure'=>$i18n['perm_configure_listing'],
				'edit'=>$i18n['perm_edit_listing'],
				'delete'=>$i18n['perm_delete_listing'],
				'order'=>$i18n['perm_order_listing'],
			);
		}
		else
		{
			return array("administrate","manage","configure","delete","order");
		}
	}

	function show($view,$loc = null, $title = '') {
		global $db;
		
		// get bible translation. select the first one. If it does not have, flow redirect
		$translation=$db->selectObjects("bibles");
		if (count($translation) == 0)
			exponent_flow_redirect();
		
		$template = new template('biblemodule',$view,$loc);
		
		$template->register_permissions(biblemodule::permissions("",1),$loc);
        // Assign page data
        $template->assign("translation",$translation);
		$template->assign('moduletitle', $title);
		$template->output();
	}

	function deleteIn($loc) {
		return false;
	}

	function copyContent($oloc,$nloc) {
		global $db;
		return false;
	}

	function searchName() {
		return false;
	}

	function spiderContent($item = null) {
		return false;
	}
}

?>
